var pageii = null;
var grid = null;
$(function() {
	grid = lyGrid({
		pagId : 'paging',
		l_column : [{
			colkey : "checkDate",
			name : "日期",
			renderData : function(rowindex,data, rowdata, column) {
				if(data!=''){
					return new Date(data).format("yyyy-MM-dd");
				}else{
					return "";
				}
			}
		}, {
			colkey : "",
			name : "机台号？？？"
		}, {
			colkey : "uninstallNo",
			name : "拆模模具号"
		}, {
			colkey : "mold_encode",
			name : "安装模具号"
		}, {
			colkey : "sortName",
			name : "类别"
		}, {
			colkey : "iSchedule",
			name : "班组",
			renderData : function(rowindex,data, rowdata, column) {
				if (data==1 || data=="1"){
					return "甲班";
				}else if (data==2 || data=="2"){
					return "乙班";
				}else{
					return "";
				}
			}
		}, {
			colkey : "iStaff1",
			name : "装模人员1"
		}, {
			colkey : "iStaff2",
			name : "装模人员2"
		}, {
			colkey : "enoughTime",
			name : "够产时间"
		}, {
			colkey : "uBeginTime",
			name : "开始拆模时间"
		}, {
			colkey : "iEndTime",
			name : "完成拆模时间"
		}, {
			colkey : "beginCheck",
			name : "开始检查时间"
		}, {
			colkey : "endRework",
			name : "返工完成时间"
		}, {
			colkey : "endCheck",
			name : "检查完成时间"
		}],
		jsonUrl : rootPath + '/zInstall/zInstall_findByPage.shtml',
		dymCol:true,
		checkbox : true,
		serNumber : false
	});
	$("#editFun").click("click", function() {
		editAccount();
	});
	$("#search").click("click", function() {
		var searchParams = $("#searchForm").serializeJson();
		grid.setOptions({
			data : searchParams
		});
	});
});
function editAccount() {
	var cbox = grid.getSelectedCheckbox();
	if (cbox.length > 1 || cbox == "") {
		layer.msg("只能选中一个");
		return;
	}
	pageii = layer.open({
		title : "编辑装模质量检查表",
		type : 2,
		area : [ "1200px", "100%" ],
		content : rootPath + '/zInstall/zInstall_edit.shtml?id=' + cbox
	});
}





